package p41_autoconfig;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import p21_参数解析器.Person;

/**
 * 自动配置类2
 * @ConditionalOnMissingBean,本项目只有缺少该bean，才加载该bean
 * 这是系统内置的条件注解
 */
@Configuration
public class Config2 {
    @Bean
    @ConditionalOnMissingBean
    public Person person2() {
        return new Person();
    }
}
